Merged
Conversation
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="tests/test_a_b_example.py">
<violation number="1" location="tests/test_a_b_example.py:72">
parse_address assumed all three trailing lines exist for city/postal/country, so addresses missing any of those fields drop street lines and mislabel the remaining data when converting B → A. Update the helper (and its duplicate in the roundtrip test) to only strip as many trailing components as are actually consumed.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| # Last 3 lines are city, postal_code, country | ||
| # Everything before is street | ||
| return { | ||
| "street": lines[:-3], |
There was a problem hiding this comment.
parse_address assumed all three trailing lines exist for city/postal/country, so addresses missing any of those fields drop street lines and mislabel the remaining data when converting B → A. Update the helper (and its duplicate in the roundtrip test) to only strip as many trailing components as are actually consumed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tests/test_a_b_example.py, line 72:
<comment>parse_address assumed all three trailing lines exist for city/postal/country, so addresses missing any of those fields drop street lines and mislabel the remaining data when converting B → A. Update the helper (and its duplicate in the roundtrip test) to only strip as many trailing components as are actually consumed.</comment>
<file context>
@@ -0,0 +1,198 @@
+ # Last 3 lines are city, postal_code, country
+ # Everything before is street
+ return {
+ "street": lines[:-3],
+ "city": lines[-3] if len(lines) >= 3 else None,
+ "postal_code": lines[-2] if len(lines) >= 2 else None,
</file context>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Added tests for transforming between nested A.json and flat B.json to validate mapper/grab behavior, name parsing, address formatting, and partial roundtrip with known limitation on previous addresses.
Written for commit dd4d244. Summary will update automatically on new commits.